package com.myproject.exception;

import com.myproject.enums.ErrorCode;

public class SystemException extends RuntimeException {
	
	private final ErrorCode errorCode;
	private final Throwable rootCause;

	public SystemException(ErrorCode errorCode, Throwable cause) {
		super(errorCode.getMessage(), cause);
		this.errorCode = errorCode;
		this.rootCause = cause;
	}

	public ErrorCode getErrorCode() {
		return errorCode;
	}

	public Throwable getRootCause() {
		return rootCause;
	}
}